import Layout from "@/views/h5/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  // PC
  {
    path: "/",
    redirect: { name: "Login" }
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/pc/login/index.vue"),
    meta: {
      title: "登录"
    }
  },
  {
    // 安全中心
    path: "/safeCenter",
    name: "SafeCenter",
    component: () => import("@/views/pc/safeCenter/index.vue"),
    redirect: { name: "Home" },
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/pc/safeCenter/home/index.vue"),
        meta: {
          title: "首页"
        }
      },
      {
        path: "accountSecurity",
        name: "AccountSecurity",
        component: () =>
          import("@/views/pc/safeCenter/accountSecurity/index.vue"),
        redirect: { name: "PersonalCenter" },
        children: [
          {
            path: "personalCenter",
            name: "PersonalCenter",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/personalCenter/index.vue"
              ),
            meta: {
              title: "个人中心"
            }
          },
          {
            path: "setAliases",
            name: "SetAliases",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/securitySettings/setAliases.vue"
              ),
            meta: {
              title: "设置别名"
            }
          },
          {
            path: "setSecurity",
            name: "SetSecurity",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/securitySettings/setSecurity.vue"
              ),
            meta: {
              title: "设置密保"
            }
          },
          {
            path: "phone",
            name: "Phone",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/securitySettings/phone.vue"
              ),
            meta: {
              title: "绑定/解绑手机"
            }
          },
          {
            path: "mail",
            name: "Mail",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/securitySettings/mail.vue"
              ),
            meta: {
              title: "绑定/解绑邮箱"
            }
          },
          {
            path: "platform",
            name: "Platform",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/securitySettings/platform.vue"
              ),
            meta: {
              title: "开启/关闭多端登录"
            }
          },
          {
            path: "loginLog",
            name: "LoginLog",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/loginLog/index.vue"
              ),
            meta: {
              title: "登录日志"
            }
          },
          {
            path: "lastLoginLog",
            name: "LastLoginLog",
            component: () =>
              import(
                "@/views/pc/safeCenter/accountSecurity/loginLog/lastLoginLog.vue"
              ),
            meta: {
              title: "最近登录记录"
            }
          }
        ]
      },
      {
        path: "passwordManagement",
        name: "PasswordManagement",
        component: () =>
          import("@/views/pc/safeCenter/passwordManagement/index.vue"),
        meta: {
          title: "密码管理"
        }
      },
      {
        path: "faq",
        name: "FAQ",
        component: () =>
          import("@/views/pc/safeCenter/frequentlyAskedQuestion/index.vue"),
        meta: {
          title: "常见问题"
        }
      }
    ]
  },
  {
    // 融合门户
    path: "/portal",
    name: "Portal",
    component: () => import("@/views/pc/portal/index.vue"),
    redirect: { name: "Teacher" },
    children: [
      {
        path: "teacher",
        name: "Teacher",
        component: () => import("@/views/pc/portal/teacher/index.vue"),
        meta: {
          title: "教师页面"
        }
      }
    ]
  }
  // h5
  // {
  //   path: "/",
  //   name: "root",
  //   component: Layout,
  //   redirect: { name: "Demo" },
  //   children: [
  //     {
  //       path: "demo",
  //       name: "Demo",
  //       component: () => import("@/views/h5/demo/index.vue"),
  //       meta: {
  //         title: "主页"
  //       }
  //     },
  //     {
  //       path: "tools",
  //       name: "Tools",
  //       component: () => import("@/views/h5/tools/index.vue"),
  //       meta: {
  //         title: "工具"
  //       }
  //     },
  //     {
  //       path: "about",
  //       name: "About",
  //       component: () => import("@/views/h5/about/index.vue"),
  //       meta: {
  //         title: "关于",
  //         noCache: true
  //       }
  //     }
  //   ]
  // }
];

export default routes;
